﻿using System;
using System.Collections.Generic;

namespace Credera.Theta.API
{
    /// <summary>
    /// Describes an input command
    /// </summary>
    /// <remarks>This class is used internally by the shell to parse and consistently define input commands from a type, and it
    /// may also be used by developers to do the same</remarks>
    public class InputCommandDef
    {
        /// <summary>
        /// Gets the type of the input command class
        /// </summary>
        public Type InputCommandType { get; set; }

        /// <summary>
        /// Gets the name of the input command
        /// </summary>
        /// <remarks>The CommandName is the name specified by the Command attribute or the name of the class if the command attribute is not defined</remarks>
        public string CommandName { get; set; }

        /// <summary>
        /// Gets the list of command aliases
        /// </summary>
        public List<string> Aliases { get; set; }

        /// <summary>
        /// Gets the list of descriptors for the parameters defined for the command type
        /// </summary>
        public List<ParameterDef> Parameters { get; set; }

        /// <summary>
        /// Gets the list of descriptors fot the switches defined for the command
        /// </summary>
        public List<SwitchDef> Switches { get; set; }

        /// <summary>
        /// A synopsis of the input command
        /// </summary>
        public string Synopsis { get; set; }

        /// <summary>
        /// The name of the default parameter set
        /// </summary>
        public string DefaultParameterSet { get; set; }

        /// <summary>
        /// Creates an instance of the <paramref name="Credera.Console.API.InputCommandDef"/> object
        /// </summary>
        public InputCommandDef()
        {
            this.CommandName = null;
            this.Aliases = new List<string>();
            this.Parameters = new List<ParameterDef>();
            this.Switches = new List<SwitchDef>();
        }
    }
}
